/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.gatech.egg.l0cUs.service.impl;

import edu.gatech.egg.l0cUs.domain.Configuration;
import edu.gatech.egg.l0cUs.service.ConfigurationDao;
import java.util.List;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 *
 * @author summerspittman
 */

@Service
@Repository
public class ConfigurationDaoJPA extends GenericDAOWithJPA<Configuration, Long> implements ConfigurationDao {

    @Override
    public Configuration getConfiguration() {
        List<Configuration> list = super.findAll();
        if (list == null || list.isEmpty()) {
            return new Configuration();
        } else {
            return list.get(0);
        }
    }
}
